package com.gitee.cirnochat.group.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.cirnochat.group.model.enums.GroupMemberRoleType;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 群聊成员
 * @TableName group_member
 */
@TableName(value ="group_member")
@Data
public class GroupMember implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 群组ID
     */
    @TableField(value = "group_id")
    private Long groupId;

    /**
     * 成员ID
     */
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 成员角色：群主/管理员/成员
     */
    @TableField(value = "role")
    private GroupMemberRoleType role;

    /**
     * 在群中的名称
     */
    @TableField(value = "nickname_in_group")
    private String nicknameInGroup;

    /**
     * 是否禁言
     */
    @TableField(value = "muted")
    private Integer muted;

    /**
     * 禁言结束时间
     */
    @TableField(value = "muted_until")
    private LocalDateTime mutedUntil;

    /**
     * 加入时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}